package ylyhappy.cn.ideavim.ui;

import android.view.MenuItem;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.navigation.NavController;

import com.google.android.material.navigation.NavigationView;

import ylyhappy.cn.ideavim.R;

/**
 * 1. init menu event bind
 */
public class NavigationUtils {

    public static void initMenus(NavigationView navigationView,NavController navController, AlertDialog dialog) {
        // item 0 Export File
        navigationView.getMenu().getItem(0).setOnMenuItemClickListener(
                new MenuItem.OnMenuItemClickListener() {
                    @Override
                    public boolean onMenuItemClick(@NonNull MenuItem item) {
//                        dialog.show();
                        return false;
                    }
                }
        );
        // item 1 Save Config -> select actions
        navigationView.getMenu().getItem(1).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
            @Override
            public boolean onMenuItemClick(@NonNull MenuItem menuItem) {
                navController.navigate(R.id.searchListFragment);
                return false;
            }
        });
    }
}
